package com.dexilaonian.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import com.dexilaonian.MainActivity;
import com.dexilaonian.R;
import com.dexilaonian.ui.BaseActivity;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class SuccessActivity extends BaseActivity {

    @Bind(R.id.back)
    ImageView back;
    @Bind(R.id.base_title_service)
    TextView baseTitleService;
    @Bind(R.id.nnn)
    TextView nnn;
    @Bind(R.id.success_name)
    TextView successName;
    @Bind(R.id.dddd)
    TextView dddd;
    @Bind(R.id.success_address)
    TextView successAddress;
    @Bind(R.id.zzz)
    TextView zzz;
    @Bind(R.id.success_pay)
    TextView successPay;
    @Bind(R.id.btn_success)
    Button btnSuccess;

    @Override
    public int getLayoutID() {
        return R.layout.activity_success;
    }

    @Override
    public void initView() {

    }

    @Override
    protected void initData() {

    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // TODO: add setContentView(...) invocation
        ButterKnife.bind(this);
      /*  intent.putExtra("real_name", real_name);
        intent.putExtra("HouseAddress", HouseAddress);
        intent.putExtra("money", money);*/
        Bundle extras = getIntent().getExtras();
        String real_name = extras.getString("real_name");
        String houseAddress = extras.getString("HouseAddress");
        String money = extras.getString("money");
        successName.setText(real_name);
        successAddress.setText(houseAddress);
        successPay.setText(money);
    }

    @OnClick({R.id.back, R.id.btn_success})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.back:
                finish();
                break;
            case R.id.btn_success:
                Intent intent = new Intent(SuccessActivity.this, MainActivity.class);
                intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                startActivity(intent);
                break;
        }
    }
}
